package router

import (
	"github.com/gin-gonic/gin"
	"go.uber.org/zap"
	"mxshop_api/order-web/api/shop_cart"
	"mxshop_api/order-web/middlewares"
)

func InitShopCartRouter(Router *gin.RouterGroup) {
	ShopCartRouter := Router.Group("/shopcarts").Use(middlewares.JWTAuth())
	// 添加健康检查路由

	zap.S().Infof("配置用户路由")
	{
		ShopCartRouter.GET("", shop_cart.List)         // 获取购物车列表
		ShopCartRouter.GET("/:id", shop_cart.Delete)   //删除条目
		ShopCartRouter.POST("", shop_cart.New)         // 添加商品到购物车
		ShopCartRouter.PATCH("/:id", shop_cart.Update) // 修改条目
	}
}
